package lab02.test13;

public class Gymnastics extends ComputerAverage {

    double score1;
    double score2;
    double score3;
    double score4;
    double score5;

    @Override
    void average(double[] scores) {
        double max;
        double min;
        double sum=0;

        min=max=scores[0];

        for (int i=0;i < scores.length; i++){
            if (scores[i]>max){
                max=scores[i];
            }else if (scores[i]<min){
                min=scores[i];
            }
        }

        for (int i=0;i<scores.length;i++){
            sum=sum+scores[i];
        }

        System.out.println("Gymnastic平均分 = " + (sum-max-min)/(scores.length-2));
    }

}
